﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Entities.BookStore;
using System.ServiceModel.Web;

namespace Services.BookStore
{
    [ServiceContract(Name="StoreService")]
   public interface IBookStoreServiceContract
    {
        [OperationContract]
        [WebGet(ResponseFormat= WebMessageFormat.Json,RequestFormat=WebMessageFormat.Json)]
        ResponseBooks GetBooks();

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
        ResponseBook FindBook(int Id);

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
        ResponseBook InsertBook(Book book);

        [OperationContract]
        [WebInvoke(Method = "PUT",  ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
        Response UpdateBook(Book book);
        
        [OperationContract]
        [WebInvoke(Method = "DELETE", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
        Response DeleteBook(int Id);

        
    }
}
